package com.story.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * 用户登录表
 * </p>
 *
 * @author yangbo
 * @since 2017-12-19
 */
@TableName("user_login")
public class UserLogin extends Model<UserLogin> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
    /**
     * 用户id
     */
	private Integer userId;
    /**
     * 登录类型
     */
	private String identityType;
    /**
     * 登录账号
     */
	private String identifier;
    /**
     * 认证码，密码或者三方token
     */
	private String credential;
    /**
     * 最近登录时间
     */
	private Date lastLoginTime;
    /**
     * 最近登录ip
     */
	private String lastLoginIp;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getIdentityType() {
		return identityType;
	}

	public void setIdentityType(String identityType) {
		this.identityType = identityType;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public String getCredential() {
		return credential;
	}

	public void setCredential(String credential) {
		this.credential = credential;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLastLoginIp() {
		return lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "UserLogin{" +
			"id=" + id +
			", userId=" + userId +
			", identityType=" + identityType +
			", identifier=" + identifier +
			", credential=" + credential +
			", lastLoginTime=" + lastLoginTime +
			", lastLoginIp=" + lastLoginIp +
			"}";
	}
}
